<?php

namespace app\common\model;

use app\common\RootModel;

class ContentReadModel extends RootModel
{
    protected $pk = 'id';
    protected $table = 'sys_content_read';

    /**
     * 获取文章id
     * @param $val
     * @return mixed
     */
    protected function getContentIdsAttr($val)
    {
        return json_decode($val, true);
    }

    /**
     * 设置文章ID
     * @param $val
     * @return false|string
     */
    protected function setContentIdsAttr($val)
    {
        return json_encode($val);
    }

}